package com.wyh.domain.vo.gfive;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 开票记录表(Invoicerecordes)实体类
 *
 * @author makejava
 * @since 2024-05-21 17:13:57
 */

@Data
@AllArgsConstructor
@NoArgsConstructor

public class InvoicerecordsVO implements Serializable {

    /**
     * 开票流水号
     */
    @ApiModelProperty("开票流水号")
    private String serialnumber;
    /**
     * 通知单编号
     */
    @ApiModelProperty("通知单编号")
    private String noticenumber;
    /**
     * 发票类型
     */
    @ApiModelProperty("发票类型")
//    private Integer invoicingtype;
    private String invoicingtype;
    /**
     * 发票代码
     */
    @ApiModelProperty("发票代码")
    private String invoicecode;
    /**
     * 发票号码
     */
    @ApiModelProperty("发票号码")
    private String invoicenumber;
    /**
     * 业主
     */
    @ApiModelProperty("业主")
//    private Integer owner;
    private String owner;
    /**
     * 购买方
     */
    @ApiModelProperty("购买方")
//    private Integer buyer;
    private String buyer;
    /**
     * 开票日期
     */
    @ApiModelProperty("开票日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date invoicingtime;
    /**
     * 开票金额
     */
    @ApiModelProperty("开票金额")
    private Double amount;
//
//    /**
//     * 订单id
//     */
//    private Integer billid;


    public InvoicerecordsVO(String serialnumber, String noticenumber, String invoicecode, String invoicenumber, Date invoicingtime, Double amount) {
        this.serialnumber = serialnumber;
        this.noticenumber = noticenumber;
        this.invoicecode = invoicecode;
        this.invoicenumber = invoicenumber;
        this.invoicingtime = invoicingtime;
        this.amount = amount;
    }

    public InvoicerecordsVO(String owner, String buyer,String invoicingtype) {
        this.owner = owner;
        this.buyer = buyer;
        this.invoicingtype = invoicingtype;
    }

    @JsonIgnore
    public boolean isEmptyT() {
        return (serialnumber == null || serialnumber.isEmpty()) &&
                (noticenumber == null || noticenumber.isEmpty()) &&
                (invoicingtype == null || invoicingtype.isEmpty()) &&
                (invoicecode == null || invoicecode.isEmpty()) &&
                (invoicenumber == null || invoicenumber.isEmpty()) &&
                (owner == null || owner.isEmpty()) &&
                (buyer == null || buyer.isEmpty()) &&
                invoicingtime == null &&
                amount == null;
    }
}

